﻿<%@ Page Language="C#" MasterPageFile="~/JOINT/MstPage_JOINT.master" AutoEventWireup="true"
    CodeFile="frmJ_StaffCareerInput.aspx.cs" Inherits="JOINT_frmJ_StaffCareerInput"
    Title="Untitled Page" Culture="ja-JP" UICulture="ja" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    職種職務情報登録
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <link href="../Style/JsStyle.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" src="../js/jquery.min.js"></script>

    <script src="../js/Validation.js" type="text/javascript"></script>

    <script language="JavaScript" type="text/javascript">
 

 $(document).ready(function() {						
				
	 registerControlToValidation("validation");	
     registerEnterEvent("next_control","<%= btn_登録.ClientID %>",7);
     formatDate("css_text_calender", "/");
     $('.default').each(function() {
         var default_value = this.value;
         $(this).css('color', '#666');
         $(this).focus(function() {
            if (this.value == default_value) {
                this.value = '';
                $(this).css('color', '#333');
            }
         });
         $(this).blur(function() {
            if (this.value == '') {
                $(this).css('color', '#666');
                this.value = default_value;
            }
         });
    });
					
});					
 function validate2DayInput2(oSrc, args)
 {//Nếu 発令開始日＞発令終了日 thì sẽ thông báo lỗi (đổi màu control)
   
      var cur = document.getElementById('ctl00_ContentPlaceHolder1_txt実際開始日').value;
      args.IsValid = checkYearOld(cur, args.Value,0, "<");         
 }

  function loadDll(){
    
         setTimeout(function() {
         var ID;
         var ManNhanVien = $("#ctl00_ContentPlaceHolder1_login").val();
         var ID1=$("#ctl00_ContentPlaceHolder1_ddl_職種").val();
         var ID2=$("#ctl00_ContentPlaceHolder1_ddl_職務").val();
         $("#flg").val("1");
         $.ajax({
                url: "frmJ_StaffCareerInput.aspx/IsExisted",
                type: "POST",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
             // data: "{人コード: '" + 人コード+ "'"+'"}"',
                data: "{ManNhanVien: '" + ManNhanVien+ "',"+"ID1:'"+ID1+"',"+"ID2:'"+ID2+"'"+  "}" ,
                success: function(data) {
                    if(data.d == false){
                   
                    $("#flg").val("0");}       
                    },     
            });
            }, 100); 
        }
         function checkDll(oSrc, args){
         
         var value = $("#flg").val();
//           var ID=$("#ctl00_ContentPlaceHolder1_ddl_企業名").val();
//           if(ID=="-1"){
//            args.IsValid = true;
//           }
     
         if(value == "0"){
                args.IsValid = true;
                }
                
         else  {
          args.IsValid = false;  }
                      
                return;
        }
   


function validateAo(oSrc, args)
{// ham validate ao nay lun gan validate =true de no tu dong goi custom validate cho text box duoi

   args.IsValid = true;
     ValidatorEnable2(document.getElementById("<%=CustomValidator2.ClientID %>"), true);
   
}
function validateAo1(oSrc, args){// ham validate ao nay lun gan validate =true de no tu dong goi custom validate cho text box duoi

   args.IsValid = true;
     ValidatorEnable2(document.getElementById("<%=CustomValidator職種コードAND職務コード.ClientID %>"), true); 
       
}

    </script>

    <input type="hidden" id="flg" value="0" />
    <asp:HiddenField ID="login" Value="0" runat="server" />
    <div class="maindiv1">
        <div class="Header1">
            ＊: 必須.</div>
        <div class="NoteStyle">
            ※下記の情報があれば、必須項目を入力してください。なければ、次ボタンを押してください。</div>
        <div>
            &nbsp;</div>
        <%-- <asp:UpdatePanel runat="server">
        <ContentTemplate>--%>
        <div class="detail-admin-row" runat="server" id="div_職種">
            <span class="detail-admin-label">職種コード :</span>
            <asp:DropDownList ID="ddl_職種" runat="server" CssClass=" validation next_control dropdownlist width2"
                OnSelectedIndexChanged="ddl_職種_SelectedIndexChanged"
                AutoPostBack="true">
                <asp:ListItem Value="-1" Selected="true">[選択]</asp:ListItem>
            </asp:DropDownList>
            <span class="required-field">*</span>
            <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" ControlToValidate="ddl_職種"
                Display="None" InitialValue="-1" ErrorMessage="">
            </asp:RequiredFieldValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender1"
                Width="240px" TargetControlID="RequiredFieldValidator1" HighlightCssClass="invalid"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
            <%-- <asp:CustomValidator runat="server" ID="CustomValidator1"   OnServerValidate="CustomValidate職種コードAND職務コード"
      ErrorMessage="" ControlToValidate="ddl_職種" Display="None"     >
        </asp:CustomValidator>
          <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender3"
        TargetControlID="CustomValidator職種コードAND職務コード" HighlightCssClass = "invalid"
        CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" /> --%>
        </div>
        <div class="detail-admin-row" runat="server" id="div_職務">
            <span class="detail-admin-label">職務コード :</span>
            <asp:DropDownList ID="ddl_職務" runat="server" CssClass="validation next_control dropdownlist width2"
                Enabled="false" AutoPostBack="true" OnSelectedIndexChanged="ddl_職務_SelectedIndexChange"
                onFocus="loadDll()" onblur="loadDll()">
                <asp:ListItem Value="-1" Selected="true">[選択]</asp:ListItem>
            </asp:DropDownList>
            <span class="required-field">*</span>
            <asp:CustomValidator runat="server" ID="CustomValidator職種コードAND職務コード" ClientValidationFunction="checkDll"
                ErrorMessage="" ControlToValidate="ddl_職務" Display="None" SetFocusOnError="false">
            </asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender6"
                TargetControlID="CustomValidator職種コードAND職務コード" HighlightCssClass="invalid1" CssClass="CustomValidatorCalloutStyle"
                WarningIconImageUrl="../Images/warning.png" />
            <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator2" ControlToValidate="ddl_職務"
                Display="None" InitialValue="-1" ErrorMessage="">
            </asp:RequiredFieldValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender12"
                Width="240px" TargetControlID="RequiredFieldValidator2" HighlightCssClass="invalid"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
            <asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="" ControlToValidate="ddl_職務"
                ClientValidationFunction="validateAo1" Display="None"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender3"
                TargetControlID="CustomValidator4" HighlightCssClass="invalid" CssClass="CustomValidatorCalloutStyle"
                WarningIconImageUrl="../Images/warning.png" />
        </div>
        <%--  </ContentTemplate>
        </asp:UpdatePanel>--%>
        <%--  <asp:UpdatePanel runat="server">
        <Triggers >
     
    <asp:AsyncPostBackTrigger  ControlID="ddl_職種" EventName="SelectedIndexChanged"/>
        </Triggers>
        </asp:UpdatePanel>--%>
        <div class="detail-admin-row" runat="server" id="div_立場">
            <span class="detail-admin-label">立場 :</span>
            <asp:TextBox ID="txt立場" TextMode="MultiLine" runat="server" ValidationGroup="detailForm"
                CssClass="textarea validation next_control width3" MaxLength="500"></asp:TextBox>
            <span class="required-field">*</span>
            <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator3" ControlToValidate="txt立場"
                Display="None" ErrorMessage="">
            </asp:RequiredFieldValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender31"
                Width="240px" TargetControlID="RequiredFieldValidator3" HighlightCssClass="invalid"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
        </div>
        <div class="detail-admin-row" runat="server" id="div_具体的業務内容">
            <span class="detail-admin-label">具体的業務内容 :</span>
            <asp:TextBox ID="txt具体的業務内容" TextMode="MultiLine" runat="server"
                ValidationGroup="detailForm" CssClass="textarea validation next_control width3" MaxLength="500"></asp:TextBox>
            <span class="required-field">*</span>
            <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator4" ControlToValidate="txt具体的業務内容"
                Display="None" ErrorMessage="">
            </asp:RequiredFieldValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender4"
                Width="240px" TargetControlID="RequiredFieldValidator4" HighlightCssClass="invalid"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
        </div>
        <div class="detail-admin-row" runat="server" id="div_実際開始日">
            <span class="detail-admin-label">実際開始日 :</span>
            <asp:TextBox ID="txt実際開始日" runat="server" ValidationGroup="detailForm" CssClass="next_control css_text_calender validation textbox width_calendar"
                onkeypress="return InputNumberKeys(this, event)" MaxLength="8" ></asp:TextBox>
            
                <asp:ImageButton ID="imb実際開始日" runat="server" ValidationGroup="detailsform"
                    CssClass="btn_calendar" ImageUrl="~/Images/calendar.jpg" />
                    <span class="required-field">*</span>
            <ajaxToolkit:CalendarExtender ID="CalendarExtender2" runat="server" Format="yyyy/MM/dd"
                PopupButtonID="imb実際開始日" TargetControlID="txt実際開始日">
            </ajaxToolkit:CalendarExtender>
            <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator5" ControlToValidate="txt実際開始日"
                Display="None" ErrorMessage="">
            </asp:RequiredFieldValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender5"
                Width="240px" TargetControlID="RequiredFieldValidator5" HighlightCssClass="invalid"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
            <asp:CustomValidator ID="CustomValidator7" runat="server" ErrorMessage="" ControlToValidate="txt実際開始日"
                ClientValidationFunction="isDate" Display="None"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender7"
                TargetControlID="CustomValidator7" HighlightCssClass="invalid1" CssClass="CustomValidatorCalloutStyle"
                WarningIconImageUrl="../Images/warning.png" />
            <asp:CustomValidator ID="CustomValidator4" runat="server" ErrorMessage="" ControlToValidate="txt実際開始日"
                ClientValidationFunction="validateAo" Display="None"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender9"
                TargetControlID="CustomValidator4" HighlightCssClass="invalid" Width="240px"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
            <br />
        </div>
        <div class="detail-admin-row" runat="server" id="div1">
            <span class="detail-admin-label">実際終了日 :</span>
            <asp:TextBox ID="txt_実際終了日" runat="server" ValidationGroup="detailForm" CssClass="next_control css_text_calender validation textbox width_calendar"
                onkeypress="return InputNumberKeys(this, event)" MaxLength="8" ></asp:TextBox>
                <asp:ImageButton ID="imb実際終了日" runat="server" CssClass="btn_calendar" ValidationGroup="detailsform"
                    ImageUrl="~/Images/calendar.jpg" />
            <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" Format="yyyy/MM/dd"
                PopupButtonID="imb実際終了日" TargetControlID="txt_実際終了日">
            </ajaxToolkit:CalendarExtender>
            <asp:CustomValidator ID="CustomValidator2" runat="server" ErrorMessage="" ControlToValidate="txt_実際終了日"
                ClientValidationFunction="validate2DayInput2" Display="None"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender2"
                TargetControlID="CustomValidator2" HighlightCssClass="invalid" Width="240px"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
            <asp:CustomValidator ID="CustomValidator3" runat="server" ErrorMessage="" ControlToValidate="txt_実際終了日"
                ClientValidationFunction="isDate" Display="None"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender8"
                TargetControlID="CustomValidator3" HighlightCssClass="invalid1" Width="240px"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
            <br />
        </div>
        <div class="detail-admin-row" runat="server" id="div2">
            <span class="detail-admin-label">変更理由 :</span>
            <asp:TextBox ID="txt_変更理由" TextMode="MultiLine" runat="server" ValidationGroup="detailForm"
               CssClass="textarea  next_control width3"></asp:TextBox>
            <span class="required-field"></span>
        </div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">&nbsp;</span>
            <asp:Button ID="btn_登録" runat="server" Text="登録" CssClass="btn" OnClick="btn_登録_Click"
                OnClientClick="javascript:focusToControlErr();" />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="btn_リセット" runat="server" Text="リセット" CausesValidation="false" Width="100px"
                OnClick="btn_リセット_Click" />
        </div>
    </div>
    <div class="detail-admin-row">
        <div class="btn_back">
            <asp:Button ID="btn_戻る" runat="server" Text="←戻る" OnClick="btn_戻る_Click" CausesValidation="false"
                Width="100px" />
        </div>
        <div class="btn_next btn_next_fixedforfrmJ_StaffBasicInfoInput">
            <asp:Button ID="btn_次" runat="server" Text="次→" OnClick="btn_次_Click" CausesValidation="false"
                Width="100px" />
        </div>
    </div>
    <div>
        &nbsp;</div>
    <br />
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <Triggers>
            <asp:PostBackTrigger ControlID="btn_登録" />
        </Triggers>
    </asp:UpdatePanel>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <Triggers>
            <asp:PostBackTrigger ControlID="btn_リセット" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
